package com.jchy.renderit.displayable;
 
import com.jchy.renderit.core.MultiPrimitiveObject;
import com.jchy.renderit.core.Point;

public class Octahedron extends MultiPrimitiveObject
{
    public Octahedron()
    {
        double octy=Math.sqrt(2);
        Point a=new Point( 0.0,-octy, 0.0);
        Point b=new Point( 1.0,  0.0, 1.0);
        Point c=new Point( 1.0,  0.0,-1.0);
        Point d=new Point(-1.0,  0.0,-1.0);
        Point e=new Point(-1.0,  0.0, 1.0);
        Point f=new Point( 0.0, octy, 0.0);
        multi.addElement(new Triangle(b,c,a));        
        multi.addElement(new Triangle(c,d,a));        
        multi.addElement(new Triangle(d,e,a));        
        multi.addElement(new Triangle(e,b,a));        
        multi.addElement(new Triangle(b,c,f));        
        multi.addElement(new Triangle(c,d,f));        
        multi.addElement(new Triangle(d,e,f));        
        multi.addElement(new Triangle(e,b,f));        
    }
}

